package com.itheima.method;

public class HelloWorld {
    public static void main(String[] args) {
        printMethod(5, "HelloWorld");
        printMethod(4, "hai");
        isEvenNumber(3);
        printOddnumber(11, 23);
    }

    public static void printMethod(int count, String mas) {
        for (int i = 0; i < count; i++) {
            System.out.println(mas);
        }
    }

    public static void isEvenNumber(int num) {
        if (num % 2 == 0) {
            System.out.println("偶数");
        } else {
            System.out.println("奇数");
        }
    }

    public static void printOddnumber(int n, int m) {
        System.out.println(n + "到" + m + "的奇数为:");
        for (int i = n; i <= m; i++) {
            if (i % 2 == 1) {
                System.out.println(i);
            }

        }
    }
}